﻿using Microsoft.AspNetCore.Mvc;
using SCM.Common;
using SCM.Common.Attributes;
using SCM.Model.DBEntity;
using SCM.Servie.IBusiness;

namespace SCM.WebAPI.Controllers
{
    /// <summary>
    /// 供应商接口
    /// </summary>
    [ApiController]
    [Route("[controller]")]
    [SCMAuthorize]
    public class SupplierController : BaseController
    {
        /// <summary>
        /// 添加供应商
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost]
        public DataPack<string> Add(T_Supplier model)
        {
            var service = GetService<ISupplierService>();
            var id = service.Add(model);
            return GetOK<string>(id);
        }
    }
}
